package com.ler.yrmall.webapp.controller;

import com.ler.yrmall.aspect.anno.AccessRecord;
import com.ler.yrmall.basic.Result;
import com.ler.yrmall.webapp.service.PanelService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Leron
 */
@AccessRecord
@RestController
@RequestMapping("/panel")
public class PanelController {

    @Resource
    private PanelService panelService;

    @GetMapping("/hoverVisited/{hover}")
    public Result<Object> monthVisited(@PathVariable Integer hover) {
        return Result.ok(panelService.monthVisited(hover));
    }

    @GetMapping("/dayVisited/{day}")
    public Result<Object> dayVisited(@PathVariable Integer day) {
        return Result.ok(panelService.dayVisited(day));
    }

    @GetMapping("/visited")
    public Result<Object> visited() {
        return Result.ok(panelService.visited());
    }

    @GetMapping("/memberCount")
    public Result<?> memberCount() {
        return Result.ok(panelService.memberCount());
    }

    @GetMapping("/orderCount")
    public Result<?> orderCount() {
        return Result.ok(panelService.orderCount());
    }

    @GetMapping("/tradeAmount")
    public Result<?> tradeAmount() {
        return Result.ok(panelService.tradeAmount());
    }

}
